<template>
  <div id="header">
    <div class="header_Icon">
      <!-- <div class="Icon_left" @click="collapseFn">
        <i :class="$store.state.iscollapse ? 'el-icon-s-unfold':'el-icon-s-fold'" ></i>
      </div> -->
      <p>项目管理系统</p>
      <div class="userinfo">
          <el-tag>管理员</el-tag>
          <span>{{username}}</span>
          <el-dropdown trigger="click" @command="aaa">
            <span class="el-dropdown-link">
              <i class="el-icon-switch-button cancel"></i>
            </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item icon="el-icon-setting" command="a" >设置</el-dropdown-item>
              <el-dropdown-item icon="el-icon-remove-outline" command="b">退出</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
      </div>
    </div>
  </div>
</template>  

<script>
export default {
  data () {
    return {
      username:'xxxx'
    };
  },
  methods: {
    // collapseFn(){
    //   let flag = !this.$store.state.iscollapse;
    //   this.$store.commit('iscollapse',flag);
    // }
    aaa(command){
      console.log('command',command);
    }
  }
};
</script>

<style lang="scss" scoped>
#header {
  height: 60px;
  padding: 0 20px;
  background-color: #fff;
  box-shadow: 0 3px 16px 0 rgba(0, 0, 0, 0.1);
  transition: 0.5s;
  box-sizing: border-box;
  .header_Icon{
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between; 
    &>P{
      font-size:20px;
      font-weight: bold;
      letter-spacing: 4px;
      color: #409EFF;
    }
    .Icon_left{
      flex:0 0 auto;
      cursor: pointer;
      i{
        font-size: 24px;
      }
    }
    .userinfo{
      flex: 0 0 auto;
      font-size: 24px;
      margin-right: 20px;
      span{
        margin-right: 10px;
      }
    }
    .cancel{
      font-size: 22px;
      cursor: pointer;
    }
  }
}

</style>
